import request from '@/utils/request'


// 获取用户列表的接口
export const reqGetUserList = (page,limit,username) =>request.get(`/admin/acl/user/${page}/${limit}/?username=${username}`)

// 添加新用户的接口
export const reqAddOrUpdateUser = (data) =>{
    if(data.id){
        request.put('/admin/acl/user/update',data)
    }else{
        request.post('/admin/acl/user/save',data)
    }
} 

// 删除某个管理用户
export const reqRemoveUser = (id) => request.delete(`/admin/acl/user/remove/${id}`)

// 批量删除的接口
export const reqBatchRemove =(ids)=>request.delete('/admin/acl/user/batchRemove',ids)



// 根据用户获取角色数据
export const reqToAssign = (userId) => request.get(`/admin/acl/user/toAssign/${userId}`)

// 给用户分配角色
export const reqDoAssign = (userId,roleId) => request.post(`/admin/acl/user/doAssign?userId=${userId}&roleId=${roleId}`)